package com.gai.adivce;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

/**
 * 环绕增强
 */
public class DelEmpinterceptor implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        System.out.println("方法名"+invocation.getMethod().getName());
        System.out.println("目标名"+invocation.getThis().getClass().getSimpleName());
        System.out.println("方法参数"+invocation.getArguments());
        System.out.println("前置");
        Object proceed = invocation.proceed();//执行目标
        System.out.println("返回值"+proceed);
        System.out.println("后置");
        return proceed;
    }
}
